﻿namespace _031委托_Lambda表达式_LINQ串讲_2Lambda表达式
{
    internal class Program
    {
        static void Main(string[] args)
        {
            //Func<int, int, int> func = new Func<int, int, int>((int a, int b) =>
            //{
            //    return a + b;
            //});

            //var func1 = new Func<int, int, int>((int a, int b) =>
            //{
            //    return a * b;
            //});
            //Console.WriteLine(func(1, 2));
            //Console.WriteLine(func1(1, 2));

            //func = (x, y) =>
            //{
            //    return x / y;
            //};

          DoSomeCalc((int a, int b) =>
            {
                var res= a + b;
                Console.WriteLine(res);
                return res;
            }, 1, 2);

        }

        static void DoSomeCalc<T>(Func<T, T, T> func, T a, T b)
        {
            func(a, b);
        }
    }
}
